<?php

/**
 * This is the model class for table "group_account".
 *
 * The followings are the available columns in table 'group_account':
 * @property integer $id ID
 * @property string $worker_name Worker Name
 * @property string $worker_password Worker Password
 * @property integer $worker_id Worker
 */
class GroupAccount extends ActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return GroupAccount the static model class
	 */
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}
	
	public function getMdcClass() {
		return 'application.models.metadata.GroupAccountMetadata';
	}
	
	public function beforeValidate() {
		$this->purview = is_array($this->purview) ? join(',', $this->purview) : $this->purview;
		return parent::beforeValidate();
	}
	
	
	public function afterFind() {
		$this->purview = empty($this->purview) ? array() : explode(',', $this->purview);
		return parent::afterFind();
	}
}